package com.cdut.hwadeefsc.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;

/**
 * 学生考勤表
 * @TableName attendance
 */
@TableName(value ="attendance")
public class attendance {
    /**
     * 主键ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 学生ID (关联 users.id)
     */
    private Long studentId;

    /**
     * 门禁系统中的学生编号
     */
    private String externalStudentNo;

    /**
     * 进出时间
     */
    private Date eventTime;

    /**
     * 方向 ("进" 或 "出")
     */
    private String direction;

    /**
     * 门禁点名称
     */
    private String gateName;

    /**
     * 主键ID
     */
    public Long getId() {
        return id;
    }

    /**
     * 主键ID
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 学生ID (关联 users.id)
     */
    public Long getStudentId() {
        return studentId;
    }

    /**
     * 学生ID (关联 users.id)
     */
    public void setStudentId(Long studentId) {
        this.studentId = studentId;
    }

    /**
     * 门禁系统中的学生编号
     */
    public String getExternalStudentNo() {
        return externalStudentNo;
    }

    /**
     * 门禁系统中的学生编号
     */
    public void setExternalStudentNo(String externalStudentNo) {
        this.externalStudentNo = externalStudentNo;
    }

    /**
     * 进出时间
     */
    public Date getEventTime() {
        return eventTime;
    }

    /**
     * 进出时间
     */
    public void setEventTime(Date eventTime) {
        this.eventTime = eventTime;
    }

    /**
     * 方向 ("进" 或 "出")
     */
    public String getDirection() {
        return direction;
    }

    /**
     * 方向 ("进" 或 "出")
     */
    public void setDirection(String direction) {
        this.direction = direction;
    }

    /**
     * 门禁点名称
     */
    public String getGateName() {
        return gateName;
    }

    /**
     * 门禁点名称
     */
    public void setGateName(String gateName) {
        this.gateName = gateName;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        attendance other = (attendance) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getStudentId() == null ? other.getStudentId() == null : this.getStudentId().equals(other.getStudentId()))
            && (this.getExternalStudentNo() == null ? other.getExternalStudentNo() == null : this.getExternalStudentNo().equals(other.getExternalStudentNo()))
            && (this.getEventTime() == null ? other.getEventTime() == null : this.getEventTime().equals(other.getEventTime()))
            && (this.getDirection() == null ? other.getDirection() == null : this.getDirection().equals(other.getDirection()))
            && (this.getGateName() == null ? other.getGateName() == null : this.getGateName().equals(other.getGateName()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getStudentId() == null) ? 0 : getStudentId().hashCode());
        result = prime * result + ((getExternalStudentNo() == null) ? 0 : getExternalStudentNo().hashCode());
        result = prime * result + ((getEventTime() == null) ? 0 : getEventTime().hashCode());
        result = prime * result + ((getDirection() == null) ? 0 : getDirection().hashCode());
        result = prime * result + ((getGateName() == null) ? 0 : getGateName().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", studentId=").append(studentId);
        sb.append(", externalStudentNo=").append(externalStudentNo);
        sb.append(", eventTime=").append(eventTime);
        sb.append(", direction=").append(direction);
        sb.append(", gateName=").append(gateName);
        sb.append("]");
        return sb.toString();
    }
}